//	SyntaxError.java

import java.io.*;

/** 
Description: CS 354

@author Teresa Cole
@author Samuel Jenkins
@version CS354 Fall 2005 - modified Fall 2008
 */
public class SyntaxError extends Exception implements Token
{

    public SyntaxError(String msg)
    {
        super("Syntax Error: " + msg);
    }

    public SyntaxError(int expected, int actual)
    {
        super("Syntax Error: Expected " +
                getText(expected) + "; found " + getText(actual));
    }

    private static String getText(int token)
    {
        String result = "";

        switch (token)
        {
            case VAR:
                result = "VAR";
                break;
            case NUMBER:
                result = "NUMBER";
                break;
            case UNKNOWN:
                result = "UNKNOWN";
                break;
            case ERROR:
                result = "ERROR";
                break;
            default:
                result = lexNames[token];
        }
        return result;
    }
}
